-- status
-- create by panyl
-- 道具：  附加状态

return {
    apply = function(source, target, classId, value)
        local summon_list = source.dbase:queryTemp("summon_list");
        if sizeof(summon_list) <= 0 then
            return;
        end

        local map = {};
        if type(value) == "number" then
            map[value] = 1;
        elseif type(value) == "table" then
            for _, id in pairs(value) do
                map[id] = 1;
            end
        end

        for _, summon in pairs(summon_list) do
            if summon and map[summon.classId] then
                local prop = { PropM.getPropId("cant_be_attack"), 1, 800, CombatM.getRound() + 4, };
                local condition = {
                    ["prop"] = prop,
                    ["end_round"] = CombatM.getRound() + 4,
                };

                CombatStatusM.applyStatus(summon, "dexterity", condition);
            end
        end
    end,
};
